package com.yangchao.ch03

class example18 {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>()
        list.add("aaa")
        list.add("bbb")

        Pojo<Long> pojo = new Pojo<>()
        pojo.setValue(1000)
        println(pojo.getValue())  //long

       //pojo.setT(2000L)

    }
}


/** 泛型类 **/
class Pojo<T>{
    T t

    T getValue(){
        t
    }

    def setValue(T t){
        this.t=t
    }
}